package cn.fz.oop1;

public class Demo07 {
    public static void main(String[] args) {
        Student2 s1 = new Student2();
        System.out.println("----------");
        Student2 s2 = new Student2(99.9);
    }
}

class Person {
    private String name;
    private int age;

    public Person() {
        System.out.println("父类无参");
    }

    // getter/setter省略
}

class Student2 extends Person {
    private double score;

    public Student2() {
        //super(); // 调用父类无参,默认就存在，可以不写，必须再第一行
        System.out.println("子类无参");
    }

    public Student2(double score) {
        //super();  // 调用父类无参,默认就存在，可以不写，必须再第一行
        this.score = score;
        System.out.println("子类有参");
    }

}
